//
//  UIButton+Extension.swift
//  XDweibo
//
//  Created by HanXingda on 15/7/3.
//  Copyright © 2015年 韩兴达. All rights reserved.
//

import UIKit
extension UIButton {
    
    convenience init(imageName: String,title: String,fontSize: CGFloat,titleColor: UIColor = UIColor.darkGrayColor()) {
        self.init()
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
        setTitleColor(titleColor, forState: UIControlState.Normal)
        setTitle(" " + title, forState: UIControlState.Normal)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
       

        
    }
    convenience init(title: String,fontSize: CGFloat,bgColor: UIColor = UIColor.brownColor(),titleColor: UIColor = UIColor.whiteColor()) {
        self.init()
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
        setTitleColor(titleColor, forState: UIControlState.Normal)
        setTitle(" " + title, forState: UIControlState.Normal)
        backgroundColor = bgColor
        
        
    }

}
